package com.example.lamda;

import com.example.functioninterfaces.InerfaceDemoA;

import java.util.function.*;

public class Functions {

    public static void main(String[] args) {

        Consumer<String> con=i-> System.out.println(i);
        con.accept("hello consumer");

        Supplier<String> sup=()->"new supplier";
        System.out.println(sup.get());

        BiFunction<String,String,String> bf=(a,b)->a+b;
        System.out.println(bf.apply("a","b"));

        Predicate<String> pre=(a)->a.isEmpty();
        System.out.println(pre.test("aaa"));

        UnaryOperator<String> uo=i->i+"sub text";
        System.out.println(uo.apply("aaa"));

        InerfaceDemoA ida=i-> System.out.println("InerfaceDemoA "+i);
        ida.dosth("nihao");



    }
}
